<?php

//load psr4 loader class
require '../Psr4AutoloaderClass.php';
//load composer
require '../vendor/autoload.php';

//最低要求PHP7.2
if (version_compare(7.2, PHP_VERSION, '>')) {
    exit('This framework need php7.2 or lastest version');
}
$loader = new \Psr\Psr4AutoloaderClass();
//define root_path
define('ROOT_PATH', __DIR__ . '/../');

//psr4 register namespace filepath
$reg_namespace_array = [
    'app\models'           => ROOT_PATH . '/app/modeles',
    'app\views'            => ROOT_PATH . '/app/views',
    'app\controller'       => ROOT_PATH . '/app/controller',
    'pcompects\FormRender' => ROOT_PATH . '/pcompects/form-render/src',
    'pcompects\rom'        => ROOT_PATH . '/pcompects/orm/src',
    'pcompects\framework'  => ROOT_PATH . '/pcompects/framework/src',
    'pcompects\http'       => ROOT_PATH . '/pcompects/http/src',
];
if (!empty($reg_namespace_array)) {
    foreach ($reg_namespace_array as $key => $value) {
        $loader->addNamespace($key, $value);
    }
}
//echo '<pre/>';
//var_dump($_SERVER);
//var_dump($_REQUEST);
//var_dump(getallheaders());
$loader->register();
require '../core.php';
new core();
